<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
    <tr>
        <td style="text-align: center"><a href="{% url 'addauthor' %}">添加</a></td>
        <td colspan="4" style="text-align: center ;font-size: 19px ;">作者展示</td>
    </tr>
    <tr >
            <form action="{% url 'search' %}" method="post">
                {% csrf_token %}
                <td colspan="4"><input type="text" name="name" placeholder="请输入要搜索的人名"></td>
                <td><input type="submit" value="搜索"></td>
            </form>
    </tr>
    <tr style="text-align: center">
        <td>序号</td>
        <td>姓名</td>
        <td colspan="3" style="text-align: center">功能</td>
    </tr>
    {% for foo in nowpage.object_list %}



    <tr>
        <td style="text-align: center">{{ foo.id }}</td>
        <td style="text-align: center">{{ foo.name }}</td>
        <td style="text-align: center"><a href="{% url 'showall' foo.id%}">查看</a></td>
        <td style="text-align: center"><a href="{% url 'delete' foo.id%}">删除</a></td>
        <td style="text-align: center"><a href="{% url 'updateauthor' foo.id%}">修改</a></td>
    </tr>
    {% endfor %}
    <tr>
        <td colspan="5" style="text-align: center">
        {% if nowpage.number > 1 %}
            <a href="{% url 'index' %}?page={{ lastpage }}">上一页</a>
        {% endif %}
        <b>第{{ nowpage.number }}页</b>
        {% if nowpage.number < maxpage %}
            <a href="{% url 'index' %}?page={{ nextpage }}">下一页</a>
        {% endif %}
        </td>
    </tr>
</table>
</body>
</html>